# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-dicttoxml
pkgname=('python2-dicttoxml' 'python-dicttoxml')
_pkgname=dicttoxml
pkgver=1.7.16
pkgrel=3
pkgdesc='Converts a Python dictionary or other native data type into a valid XML string.'
arch=('any')
url='https://pypi.python.org/pypi/dicttoxml/'
license=('GPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('ac9d5b0f8acd0a18f918309cacba131843feebd6ad7c94935062d6e1ed7b529c5b91d6a9b65787647f73616e974d0599e8515bb07d69b036483d3a733e4dec6a')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-dicttoxml() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-dicttoxml() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

